package com.briup.srms.project.web.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.briup.srms.project.bean.EmployeeChannelProject;
import com.briup.srms.project.service.IEmployeeChannelProjectService;
import com.briup.srms.project.vm.EmployeeChannelProjectVM;
import com.jacky.base.utils.Message;
import com.jacky.base.utils.MessageUtil;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * @program: 杰普学生管理系统
 * @description: 毕业设计项目任务分配的控制器类
 * @author: charles
 * @create: 2021-1-14 11:09
 **/
@Api(description="毕业设计任务分配相关接口")
@Validated
@RestController
@RequestMapping("/project/ecp")
public class EmployeeChannelProjectController {
	
	@Autowired
	private IEmployeeChannelProjectService employeeChannelProjectService;

	@ApiOperation(value = "获取毕业设计任务分配信息")
	@GetMapping("query")
	public Message query() {
		List<EmployeeChannelProjectVM> list = employeeChannelProjectService.query();
		return MessageUtil.success(list);
	}
	
	@ApiOperation(value = "毕业设计任务分配")
	@PostMapping("assignment")
	public Message assignment (Long[] channelIds,EmployeeChannelProject ecp) {
		employeeChannelProjectService.assignment(channelIds ,ecp);
		return MessageUtil.success("分配成功");
	}
	
	
	
}
